import time,threading
def loop():
  print("创建了线程%s" % threading.current_thread().name)
  for n in range(5):
    print("线程%s循环第%s次" % (threading.current_thread().name,n+1))
    time.sleep(1)
  print("线程%s运行结束" % threading.current_thread().name)
print("主线程%s开始" % threading.current_thread().name)
t= threading.Thread(target=loop,name="LoopThread")
t.start()
t.join()
print("线程%s运行结束"% threading.current_thread().name)
